/*
 * Copyright (C) 2014 Stefan Schweitzer
 *
 * This software was created by Stefan Schweitzer as a student's project at
 * Fachhochschule Kaiserslautern (University of Applied Sciences).
 * Supervisor: Professor Dr. Thomas Allweyer. For more information please see
 * http://www.fh-kl.de/~allweyer
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this Software except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.googlecode.bpmn_simulator.gui.instances;

import javax.swing.JFrame;
import javax.swing.JScrollPane;

import com.googlecode.bpmn_simulator.animation.token.RootInstances;
import com.googlecode.bpmn_simulator.gui.Messages;

@SuppressWarnings("serial")
public class InstancesFrame
		extends JFrame {

	private static final int DEFAULT_WIDTH = 300;
	private static final int DEFAULT_HEIGHT = 200;

	private final InstancesTree treeInstances = new InstancesTree();

	public InstancesFrame() {
		super(Messages.getString("Instances.instances")); //$NON-NLS-1$

		setDefaultCloseOperation(HIDE_ON_CLOSE);

		setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);

		setAlwaysOnTop(true);

		create();
	}

	public void setInstanceManager(final RootInstances instances) {
		treeInstances.setInstances(instances);
	}

	protected void create() {
		getContentPane().add(new JScrollPane(treeInstances));
	}

}
